package com.bwie.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author: tsh
 * @Date: 2025/7/21 20:50
 * @Description: TODO
 **/

@Configuration
public class MyThreadPool {

    @Bean
    public ThreadPoolExecutor  threadPoolExecutor (){
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                16,
                32,
                0L,
                TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>(),
                Executors.defaultThreadFactory());
        return threadPoolExecutor;
    }
}
